import java.util.*;

public class HJ27 {//查找兄弟单词，思路：先查找出兄弟单词存入
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str=in.nextLine();
        String[] str1 =str.split(" ");
        int n = Integer.parseInt(str1[0]);
        String temple =str1[n+1];//字符串X
        int k = Integer.parseInt(str1[n+2]);
        List<String> list = new ArrayList<>();//存储兄弟字符串

        for (int i = 1; i <=n ; i++) {
            if (isBrother(temple,str1[i])){
                list.add(str1[i]);
            }
        }
        int size = list.size();
        System.out.println(size);
        if (size>=k){
            Collections.sort(list);
            System.out.print(list.get(k-1));
        }
    }
    public static boolean isBrother(String x,String y){
        if (x.length()!=y.length()||y.equals(x)){
            return false;
        }
        char[] s = x.toCharArray();
        char[] j= y.toCharArray();
        Arrays.sort(s);
        Arrays.sort(j);
        return new String(s).equals(new String(j));//比对组成字符串的字母是否相同
    }
}